package com.xueba.framework.domain.course.response;

import com.google.common.collect.ImmutableMap;
import com.xueba.framework.common.model.response.ResultCode;
import io.swagger.annotations.ApiModelProperty;
import lombok.ToString;

/**
 * @author Kidy
 * @date 2020/7/31 10:20
 */
@ToString
public enum CourseCode implements ResultCode {
    COURSE_DENIED_DELETE(false, 12001, "删除课程失败，只允许删除本机构的课程！"),
    COURSE_PUBLISH_PERVIEWISNULL(false, 12002, "还没有进行课程预览！"),
    COURSE_PUBLISH_CDETAILERROR(false, 12003, "创建课程详情页面出错！"),
    COURSE_PUBLISH_COURSEIDISNULL(false, 12004, "课程Id为空！"),
    COURSE_PUBLISH_VIEWERROR(false, 12005, "发布课程视图出错！");

    //操作是否成功
    @ApiModelProperty(value = "操作是否成功", example = "true", required = true)
    boolean success;
    //操作代码
    @ApiModelProperty(value = "操作代码", example = "10000", required = true)
    int code;
    //提示信息
    @ApiModelProperty(value = "操作提示", example = "操作成功", required = true)
    String message;

    private CourseCode(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
